<template>
  <div class="building-type-test">
    <h2>建筑类型选择器测试</h2>
    <p>测试修复后的建筑类型选择器，验证红框部分的选项名称是否正确显示</p>
    
    <BuildingTypeSelector
      v-model="selectedTypes"
      :max-select="10"
      @change="handleChange"
    />
    
    <div class="test-result">
      <h3>测试结果：</h3>
      <p>选中的类型ID: {{ selectedTypes }}</p>
      <p>组合结果: {{ combinedResult }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import BuildingTypeSelector from '@/components/BuildingTypeSelector/index.vue'

const selectedTypes = ref<number[]>([])
const combinedResult = ref<string>('')

const handleChange = (types: number[], result: string) => {
  console.log('选中的类型:', types)
  console.log('组合结果:', result)
  combinedResult.value = result
}
</script>

<style scoped>
.building-type-test {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.test-result {
  margin-top: 20px;
  padding: 16px;
  background: #f5f7fa;
  border-radius: 8px;
  border-left: 4px solid #409eff;
}

.test-result h3 {
  margin: 0 0 12px 0;
  color: #303133;
}

.test-result p {
  margin: 8px 0;
  color: #606266;
}
</style>
